
import { Layout } from '../../components/header/layout/layout';
import './home.less';
import { HeaderUserInfo } from '../../project-component/header-user-info/header-user-info';
import { HeaderNavs } from '../../project-component/header-navs/header-navs'
import { Route, Redirect } from 'react-router';
import { Workbench } from './workbench/workbench';
import { lazy, Suspense } from 'react';
const OrganizationComponent = lazy(() => import('./organization/index'));
export default function HomeComponent () {

    const Logo = (
        <a className="logo-href">
            <img src="/assets/images/logo.svg"/>
        </a>
    );

    const userInfoComponent = (<HeaderUserInfo username="11124(李攀)"></HeaderUserInfo>);

    const navs = [
        {
            path: '/company-manage',
            name: '企业管理'
        },
        {
            path: '/workbench',
            name: '工作台'
        },
        {
            path: '/organization',
            name: '组织管理'
        }
    ]
    return (
        <div className="outer-container">
            <div className="home-container">
                <Layout logo={Logo} userinfo={userInfoComponent}>
                    <HeaderNavs navs={navs} ></HeaderNavs>
                </Layout>
            </div>
            <div className="content">
                <Route path="/workbench" exact component={Workbench}></Route>
                <Route path="/organization" exact component={OrganizationComponent}></Route>
                {/* <Redirect path="/" to="/workbench"></Redirect> */}
            </div>
        </div>
    );
}